/***********************************************************************
 * Module:  InformRuleController.java
 * Author:  Administrator
 * Purpose: Defines the Class InformRuleController
 ***********************************************************************/

package ishitong.rvims.inform.controller;

import ishitong.rvims.inform.service.InformRuleService;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import ishitong.rvims.domain.inform.InformRule;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import ishitong.core.common.ActionController;
import ishitong.core.common.SQLSelectWhere;

/** @pdOid 725b8630-928d-4b5d-87f0-fd07e20ec460 */
@Controller
public class InformRuleController extends ActionController {
   /** @pdOid b061dd92-7aed-4b7a-a8e1-fbf2476deaa4
       @pdRoleInfo migr=yes name=InformRuleService assc=association1 */
   @Autowired
   private InformRuleService informRuleService;
   
   /** @param request 
    * @param response
    * @exception Exception
    * @pdOid 30434404-b451-422e-b74d-8cef55d084c8 */
   @RequestMapping(value = "/ajaxShowInformRuleDialog.do")
   public ModelAndView ajaxShowInformRuleDialog(HttpServletRequest request, HttpServletResponse response) throws Exception {
      return new ModelAndView("inform/InformRuleDialog");
   }
   
   /** @param request 
    * @param response 
    * @param sQLSelectWhere
    * @exception Exception
    * @pdOid 59f3c913-1a2c-4bea-a709-a3b77d0e4b9f */
   @RequestMapping(value = "/ajaxFindInformRuleSelectList.do")
   public ModelAndView handleAjaxFindInformRuleSelectList(HttpServletRequest request, HttpServletResponse response, SQLSelectWhere sQLSelectWhere) throws Exception {
   try {
     		Map<String, Object> model = new HashMap<String, Object>();
     		sQLSelectWhere.setStrParam1("%"+sQLSelectWhere.getStrParam1() + "%");
     		List<InformRule> listInformRuleLeft = informRuleService.findInformRuleList(sQLSelectWhere);
     		model.put("listInformRuleLeft", listInformRuleLeft);
     		return new ModelAndView("inform/InformRuleListForSelect", model);
     	} catch (Exception e) {
     		e.printStackTrace();
     	}
       return null;
    }

}